package com.beichuan_travel.utils;

import com.alibaba.fastjson.JSONObject;
import com.beichuan_travel.enums.ResultCode;
import com.beichuan_travel.model.vo.ResultVO;
import org.springframework.stereotype.Component;

@Component
public class ResponseResult {

    public ResultVO ok(Object data) {
        return new ResultVO(ResultCode.SUCCESSED, data);
    }

    public ResultVO ok() {
        return new ResultVO(ResultCode.SUCCESSED);
    }

    public ResultVO faile() {
        return new ResultVO(ResultCode.FAILED);
    }

    public ResultVO empty() {
        return new ResultVO(ResultCode.EMPTY);
    }

    public ResultVO unvalid() {return new ResultVO(ResultCode.VALIDATE_FAILED);}

    public ResultVO unvalid(String msg) {return new ResultVO(ResultCode.VALIDATE_FAILED, msg);}
}
